.ly-ai {
  --ai-ink: #071711;
  --ai-deep: #0a2419;
  --ai-green: #174d36;
  --ai-sage: #a7c59f;
  --ai-paper: #eef2e8;
  --ai-line: rgba(197, 220, 194, 0.25);
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}
.ly-ai-launcher {
  position: fixed;
  right: 6.75%;
  bottom: clamp(110px, 14vh, 160px);
  z-index: 94;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 1px solid rgba(208, 232, 207, 0.38);
  border-radius: 50%;
  background: rgba(7, 29, 20, 0.9);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.32),
    inset 0 1px rgba(255, 255, 255, 0.08);
  color: #e7f1df;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  cursor: pointer;
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.3s,
    border-color 0.3s;
}
.ly-ai-launcher:hover {
  transform: translateY(-4px);
  background: rgba(15, 55, 38, 0.95);
  border-color: rgba(208, 232, 207, 0.68);
}
.ly-ai-launcher-mark {
  position: relative;
  width: 36px;
  height: 37px;
  border-radius: 0;
  display: grid;
  place-items: center;
  background: none;
  color: transparent;
  box-shadow: none;
}
.ly-ai-launcher-mark img.ly-ai-logo {
  width: 36px;
  height: auto;
  display: block;
}
.ly-ai-orbit img.ly-ai-logo {
  width: 27px;
  height: auto;
  display: block;
}
.ly-ai-launcher-mark svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.ly-ai-launcher-mark i {
  position: absolute;
  right: 0;
  top: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a8edb9;
  box-shadow: 0 0 0 4px rgba(117, 223, 152, 0.12);
  animation: ly-ai-pulse 2.2s ease-out infinite;
}
.ly-ai.unavailable .ly-ai-launcher-mark i,
.ly-ai.unavailable .ly-ai-identity em i {
  background: #c8aa72;
  box-shadow: 0 0 0 4px rgba(200, 170, 114, 0.12);
  animation: none;
}
.ly-ai.unavailable .ly-ai-compose textarea,
.ly-ai.unavailable .ly-ai-compose button {
  cursor: not-allowed;
  opacity: 0.62;
}
.ly-ai-launcher > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.ly-ai-launcher b {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
}
.ly-ai-launcher small {
  font:
    7px/1 Arial,
    sans-serif;
  letter-spacing: 1.7px;
  color: #8fae94;
}
.ly-ai-launcher em {
  margin-left: auto;
  font-style: normal;
  color: #9fc4a2;
  font-size: 15px;
  transition: transform 0.35s;
}
.ly-ai-launcher:hover em {
  transform: rotate(45deg);
}
.ly-ai-backdrop {
  position: fixed;
  inset: 0;
  z-index: 105;
  background: rgba(2, 13, 9, 0.48);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.35s,
    visibility 0.35s;
}
.ly-ai-panel {
  position: fixed;
  z-index: 106;
  right: clamp(16px, 2.8vw, 42px);
  top: clamp(16px, 3vh, 34px);
  bottom: clamp(16px, 3vh, 34px);
  width: min(438px, calc(100vw - 32px));
  display: grid;
  grid-template-rows: auto auto minmax(120px, 1fr) auto auto;
  overflow: hidden;
  border: 1px solid rgba(214, 234, 209, 0.3);
  border-radius: 24px;
  background: linear-gradient(
    160deg,
    rgba(13, 45, 31, 0.98),
    rgba(5, 23, 16, 0.985)
  );
  box-shadow:
    0 35px 100px rgba(0, 0, 0, 0.55),
    inset 0 1px rgba(255, 255, 255, 0.07);
  color: #eaf2e5;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(30px, 0, 0) scale(0.96);
  transform-origin: right bottom;
  transition:
    opacity 0.38s,
    visibility 0.38s,
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.ly-ai.open .ly-ai-backdrop,
.ly-ai.open .ly-ai-panel {
  opacity: 1;
  visibility: visible;
}
.ly-ai.open .ly-ai-panel {
  transform: none;
}
.ly-ai.open .ly-ai-launcher {
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
}
.ly-ai-head {
  position: relative;
  inset: auto;
  z-index: auto;
  height: 88px;
  padding: 0 22px 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ai-line);
}
.ly-ai-identity {
  display: flex;
  align-items: center;
  gap: 15px;
}
.ly-ai-identity > span:last-child {
  display: flex;
  flex-direction: column;
}
.ly-ai-identity small {
  font:
    7px/1 Arial,
    sans-serif;
  letter-spacing: 1.8px;
  color: #7ca089;
}
.ly-ai-identity b {
  font-family: Georgia, "Songti SC", serif;
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 2px;
  margin: 6px 0;
}
.ly-ai-identity em {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.8px;
  color: #91ac97;
}
.ly-ai-identity em i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #83d69c;
}
.ly-ai-orbit {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(216, 236, 207, 0.08);
  border: 1px solid rgba(216, 236, 207, 0.22);
}
.ly-ai-orbit svg {
  width: 20px;
  height: 20px;
  fill: #c6ddba;
}
.ly-ai-orbit > i {
  position: absolute;
  width: 42px;
  height: 18px;
  border: 1px solid rgba(160, 201, 164, 0.23);
  border-radius: 50%;
  transform: rotate(35deg);
}
.ly-ai-orbit > i:last-child {
  transform: rotate(-35deg);
}
.ly-ai-close {
  width: 37px;
  height: 37px;
  padding: 0;
  border: 1px solid rgba(215, 235, 210, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  color: #bdcdb8;
  font: 300 24px/1 Arial;
  cursor: pointer;
  transition:
    background 0.3s,
    transform 0.35s;
}
.ly-ai-close:hover {
  background: #dbe8d4;
  color: #0a2117;
  transform: rotate(90deg);
}
.ly-ai-intro {
  padding: 20px 24px 17px;
  background: linear-gradient(90deg, rgba(155, 196, 158, 0.08), transparent);
  border-bottom: 1px solid rgba(197, 220, 194, 0.12);
}
.ly-ai-intro span {
  font:
    7px/1 Arial,
    sans-serif;
  letter-spacing: 2px;
  color: #81aa8b;
}
.ly-ai-intro p {
  margin: 9px 0 0;
  font-size: 11px;
  line-height: 1.8;
  color: #a8b9aa;
}
.ly-ai-messages {
  padding: 22px 20px 16px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #52725b transparent;
}
.ly-ai-message {
  width: 88%;
  margin: 0 0 18px;
  padding: 15px 16px;
  border-radius: 4px 17px 17px 17px;
  background: rgba(237, 244, 230, 0.94);
  color: #183226;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  animation: ly-ai-message-in 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.ly-ai-message.user {
  margin-left: auto;
  border-radius: 17px 4px 17px 17px;
  background: #285d43;
  color: #eef4e8;
}
.ly-ai-message.error {
  background: #f2e8dc;
  color: #704a36;
}
.ly-ai-message-label {
  display: block;
  margin-bottom: 8px;
  font:
    7px/1 Arial,
    sans-serif;
  letter-spacing: 1.7px;
  color: #66816b;
}
.ly-ai-message.user .ly-ai-message-label {
  color: #9bc4a4;
}
.ly-ai-message p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.85;
  letter-spacing: 0.15px;
}
.ly-ai-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px solid rgba(37, 81, 56, 0.12);
}
.ly-ai-sources small {
  width: 100%;
  font-size: 8px;
  color: #809085;
}
.ly-ai-sources a {
  padding: 6px 9px;
  border-radius: 20px;
  background: rgba(21, 72, 48, 0.08);
  font-size: 9px;
  color: #315f43;
  text-decoration: none;
}
.ly-ai-sources a:hover {
  background: #245b3f;
  color: #fff;
}
.ly-ai-message.pending > div {
  display: flex;
  gap: 5px;
  padding: 3px 0;
}
.ly-ai-message.pending i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #67876d;
  animation: ly-ai-thinking 1.15s infinite ease-in-out;
}
.ly-ai-message.pending i:nth-child(2) {
  animation-delay: 0.15s;
}
.ly-ai-message.pending i:nth-child(3) {
  animation-delay: 0.3s;
}
.ly-ai-suggestions {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 20px 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ly-ai-suggestions.hidden {
  display: none;
}
.ly-ai-suggestions button {
  flex: none;
  padding: 8px 11px;
  border: 1px solid rgba(189, 215, 188, 0.2);
  border-radius: 20px;
  background: rgba(181, 211, 181, 0.06);
  color: #a9c1aa;
  font-size: 9px;
  cursor: pointer;
  transition: 0.25s;
}
.ly-ai-suggestions button:hover {
  background: rgba(207, 230, 204, 0.14);
  color: #e6f0df;
}
.ly-ai-compose {
  padding: 16px 20px 17px;
  background: rgba(3, 18, 12, 0.7);
  border-top: 1px solid var(--ai-line);
}
.ly-ai-compose > label {
  display: block;
  margin: 0 0 9px;
  font-size: 8px;
  letter-spacing: 1.1px;
  color: #78937f;
}
.ly-ai-compose > div {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  border: 1px solid rgba(207, 229, 202, 0.26);
  border-radius: 16px;
  background: rgba(239, 245, 233, 0.07);
  transition:
    border-color 0.25s,
    background 0.25s;
}
.ly-ai-compose > div:focus-within {
  border-color: rgba(180, 220, 184, 0.62);
  background: rgba(239, 245, 233, 0.1);
}
.ly-ai-compose textarea {
  flex: 1;
  min-width: 0;
  max-height: 112px;
  padding: 7px 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: #e7efe3;
  font: 12px/1.7 inherit;
}
.ly-ai-compose textarea::placeholder {
  color: #768c7a;
}
.ly-ai-compose button {
  flex: none;
  height: 36px;
  padding: 0 6px 0 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 20px;
  background: #dbe8d2;
  color: #10271b;
  cursor: pointer;
  font-size: 9px;
}
.ly-ai-compose button b {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #173f2c;
  color: #eaf3e4;
  font-size: 14px;
}
.ly-ai-compose button:disabled {
  opacity: 0.45;
  cursor: wait;
}
.ly-ai-compose > p {
  display: flex;
  justify-content: space-between;
  margin: 8px 2px 0;
  font-size: 7px;
  color: #667d6c;
}
.ly-ai-compose output {
  font:
    7px Arial,
    sans-serif;
}
/* 良医AI 在所有页面常驻：子页面不隐藏，仅在与面板同屏时让位。 */
.subpage-open .ly-ai-launcher {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.ai-open #stage {
  filter: brightness(0.72);
  transition: filter 0.4s;
}
@keyframes ly-ai-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(117, 223, 152, 0.35);
  }
  70%,
  100% {
    box-shadow: 0 0 0 8px rgba(117, 223, 152, 0);
  }
}
@keyframes ly-ai-message-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes ly-ai-thinking {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
@media (max-width: 750px) {
  .ly-ai-launcher {
    right: 16px;
    bottom: 70px;
    width: 54px;
    height: 54px;
  }
  .ly-ai-launcher-mark {
    width: 33px;
    height: 34px;
  }
  .ly-ai-launcher-mark img.ly-ai-logo {
    width: 33px;
  }
  .ly-ai-panel {
    inset: 0;
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    transform: translateY(24px);
    grid-template-rows: auto auto minmax(100px, 1fr) auto auto;
  }
  .ly-ai-head {
    height: 78px;
    padding: 0 17px;
  }
  .ly-ai-intro {
    padding: 16px 19px 14px;
  }
  .ly-ai-messages {
    padding: 18px 15px 12px;
  }
  .ly-ai-message {
    width: 91%;
    margin-bottom: 14px;
  }
  .ly-ai-suggestions {
    padding: 0 15px 12px;
  }
  .ly-ai-compose {
    padding: 13px 15px max(14px, env(safe-area-inset-bottom));
  }
  .ly-ai-compose button span {
    display: none;
  }
  .ly-ai-compose button {
    padding: 5px;
  }
  .ly-ai-compose button b {
    width: 28px;
    height: 28px;
  }
  .ly-ai-backdrop {
    display: none;
  }
}

/* 良医AI: one independent symbol shared across all assistant surfaces. */
.ly-ai-launcher {
  background: radial-gradient(circle at 72% 15%, #28694e, #103b2c 50%, #08281e);
  border-color: rgba(169, 255, 212, .55);
  box-shadow: 0 12px 35px #0005, inset 0 1px 2px #caffdf55;
  isolation: isolate;
}
.ly-ai-launcher::before {
  content: "";
  position: absolute;
  inset: -7px;
  border: 1px solid #a9ffd430;
  border-radius: 50%;
  box-shadow: 0 0 24px #7cebb633;
  animation: ly-ai-halo 3.8s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}
.ly-ai-launcher::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 0%, #deffec 0 2px, transparent 3px);
  filter: drop-shadow(0 0 4px #a9ffd4);
  animation: ly-ai-spark 10s linear infinite;
  pointer-events: none;
}
.ly-ai-launcher:hover, .ly-ai-launcher:focus-visible {
  animation-play-state: paused;
  border-color: #caffdf;
  background: #174c37;
}
.ly-ai-launcher:focus-visible { outline: 2px solid #d4ffe7; outline-offset: 7px; }
.ly-ai-launcher-mark { width: 44px; height: 44px; animation: ly-ai-float 5s ease-in-out infinite; }
.ly-ai-launcher:hover .ly-ai-launcher-mark, .ly-ai-launcher:focus-visible .ly-ai-launcher-mark { animation-play-state: paused; }
.ly-ai-launcher-mark img.ly-ai-logo { width: 44px; height: 44px; }
.ly-ai-logo {
  filter: drop-shadow(0 0 4px #88ffc177);
  transition: transform .65s cubic-bezier(.2,.8,.2,1), filter .4s;
}
.ly-ai-launcher:hover .ly-ai-logo { transform: rotate(12deg) scale(1.08); filter: drop-shadow(0 0 7px #88ffc1aa); }
.ly-ai-launcher > .ly-ai-launcher-name {
  position: absolute;
  top: calc(100% + 13px);
  left: 50%;
  transform: translateX(-50%);
  display: block;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  color: #c6efda;
  text-shadow: 0 2px 8px #001b12;
}
.ly-ai-orbit {
  border-radius: 15px;
  background: radial-gradient(circle at 80% 10%, #2b694f, #0b3023 75%);
  border-color: #a9ffd43d;
  box-shadow: inset 0 1px 1px #d4ffe722;
}
.ly-ai-orbit img.ly-ai-logo { width: 36px; height: 36px; }
.ly-ai-message-label { display: flex; align-items: center; gap: 7px; }
.ly-ai-message-avatar {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: #123f2e;
  border-radius: 8px;
}
.ly-ai-message-avatar .ly-ai-logo { width: 22px; height: 22px; }
@keyframes ly-ai-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes ly-ai-halo { 0%, 100% { opacity: .4; transform: scale(.96); } 50% { opacity: .9; transform: scale(1.06); } }
@keyframes ly-ai-spark { to { transform: rotate(360deg); } }
@media (max-width: 750px) {
  .ly-ai-launcher { bottom: max(108px, calc(env(safe-area-inset-bottom) + 92px)); }
  .ly-ai-launcher-mark, .ly-ai-launcher-mark img.ly-ai-logo { width: 38px; height: 38px; }
  .ly-ai-launcher > .ly-ai-launcher-name { font-size: 10px; top: calc(100% + 10px); }
}


/* Small jade sphere: a rotating 3D surface under a fixed light source. */
.ly-ai-launcher {
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  isolation: isolate;
}
.ly-ai-launcher::before, .ly-ai-launcher::after { content: none; }
.ly-ai-launcher:hover, .ly-ai-launcher:focus-visible {
  transform: none;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.ly-ai-launcher-mark {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  perspective: 160px;
  animation: none;
  background: radial-gradient(circle at 29% 23%, #a1d6b7 0%, #528f73 18%, #215b42 43%, #103c2b 65%, #04170f 100%);
  box-shadow: inset -5px -7px 10px #00150db3, inset 1px 1px 2px #ddffed66, 0 6px 12px #0005;
}
.ly-ai-launcher-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 28% 21%, #ecfff08c 0%, #dcffe433 10%, transparent 33%);
  pointer-events: none;
  z-index: 3;
}
.ly-ai-sphere-turn {
  position: absolute;
  inset: 1px;
  border-radius: 50%;
  transform-style: preserve-3d;
  animation: ly-ai-sphere-spin 12s linear infinite;
}
.ly-ai-sphere-turn > i {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  border: 1px solid #b7efd059;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  animation: none;
}
.ly-ai-sphere-turn > i:nth-child(1) { transform: rotateY(0deg); }
.ly-ai-sphere-turn > i:nth-child(2) { transform: rotateY(45deg); }
.ly-ai-sphere-turn > i:nth-child(3) { transform: rotateY(90deg); }
.ly-ai-sphere-turn > i:nth-child(4) { transform: rotateY(135deg); }
.ly-ai-launcher-mark img.ly-ai-logo,
.ly-ai-launcher:hover .ly-ai-logo {
  position: relative;
  z-index: 2;
  width: 27px;
  height: 27px;
  opacity: .9;
  transform: none;
  filter: none;
  animation: none;
}
@keyframes ly-ai-sphere-spin {
  from { transform: rotateZ(-20deg) rotateY(0deg); }
  to { transform: rotateZ(-20deg) rotateY(360deg); }
}
@media (max-width: 750px) {
  .ly-ai-launcher { width: 44px; height: 44px; }
  .ly-ai-launcher-mark { width: 100%; height: 100%; }
  .ly-ai-launcher-mark img.ly-ai-logo { width: 25px; height: 25px; }
}

/* The WebGL sphere owns all lighting and rotation; no CSS rings or overlay icon. */
.ly-ai-launcher-mark, .ly-ai-launcher:hover .ly-ai-launcher-mark {
  animation: none; perspective: none; overflow: visible;
  background: transparent; box-shadow: none;
}
.ly-ai-launcher-mark::after { content: none; }
.ly-ai-sphere-canvas { display: none; position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 4px 4px #0005); }
.ly-ai.sphere-ready .ly-ai-sphere-canvas { display: block; }
.ly-ai.sphere-ready .ly-ai-launcher-mark img.ly-ai-logo { display: none; }

/* 球体底部标注：与官网正文同一字体栈。 */
.ly-ai-launcher > .ly-ai-launcher-name {
  position: absolute;
  top: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  display: block;
  white-space: nowrap;
  font-family: 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  text-indent: 2px;
  color: #ecdcbb;
  text-shadow: 0 2px 8px #001b12;
  pointer-events: none;
}

/* 悬浮微动效：球体轻抬放大、标注提亮（旋转加速/辉光增强由着色器 energy 处理）。 */
.ly-ai-launcher {
  transition: transform .4s cubic-bezier(.16, 1, .3, 1);
}
.ly-ai-launcher:hover {
  transform: translateY(-3px) scale(1.08);
}
.ly-ai-launcher:hover .ly-ai-launcher-name {
  color: #fff6e0;
  text-shadow: 0 2px 10px #001b12, 0 0 14px #ffdf9b66;
}

/* 子页面背景明暗不一：标注加一层深色玻璃底，任何区块都清晰。 */
.subpage-open .ly-ai-launcher > .ly-ai-launcher-name {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(8, 26, 19, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #f3ead9;
  text-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .ly-ai *, .ly-ai *::before, .ly-ai *::after {
    animation: none !important;
    transition: none !important;
  }
  .ly-ai-messages {
    scroll-behavior: auto;
  }
}

