/* ============================================
   SkyCetus 2.1 — 漂浮光点 · Floating Lux
   全局悬浮组件 · 对话 + 打赏 + 登录
   ============================================ */

/* ── Floating Lux Button ── */
.floating-lux {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.9), rgba(139, 122, 212, 0.9));
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4), 0 0 40px rgba(212, 175, 55, 0.2);
  transition: all 0.3s ease;
  user-select: none;
}

.floating-lux:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(212, 175, 55, 0.6), 0 0 60px rgba(212, 175, 55, 0.3);
}

.floating-lux:active {
  transform: scale(0.95);
}

.floating-lux.dragging {
  cursor: grabbing;
  opacity: 0.8;
}

.floating-lux-icon {
  font-size: 1.4rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.floating-lux-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid var(--space-deep);
  display: none;
}

.floating-lux-badge.show {
  display: block;
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ── Chat Panel ── */
.lux-panel {
  position: fixed;
  bottom: 6rem;
  right: 2rem;
  width: 380px;
  max-width: calc(100vw - 2rem);
  max-height: 70vh;
  background: rgba(5, 5, 16, 0.98);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 20px;
  z-index: 9998;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(212, 175, 55, 0.1);
  backdrop-filter: blur(20px);
}

.lux-panel.open {
  display: flex;
  animation: lux-in 0.3s ease;
}

@keyframes lux-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Panel Header */
.lux-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--white-05);
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.05), transparent);
}

.lux-panel-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.lux-panel-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.lux-panel-info h4 {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 0.15rem;
}

.lux-panel-info span {
  font-size: 0.7rem;
  color: var(--white-30);
}

.lux-panel-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--white-30);
  font-size: 1.4rem;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lux-panel-close:hover {
  background: var(--white-05);
  color: var(--white);
}

/* Panel Body */
.lux-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  min-height: 200px;
}

/* Messages */
.lux-messages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lux-msg {
  max-width: 85%;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  font-size: 0.85rem;
  line-height: 1.7;
  animation: msg-fade 0.3s ease;
}

@keyframes msg-fade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.lux-msg-ai {
  align-self: flex-start;
  background: rgba(139, 122, 212, 0.1);
  border: 1px solid rgba(139, 122, 212, 0.15);
  color: var(--white-70);
  border-bottom-left-radius: 4px;
}

.lux-msg-user {
  align-self: flex-end;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.15);
  color: var(--white-60);
  border-bottom-right-radius: 4px;
}

.lux-msg-name {
  font-size: 0.7rem;
  color: var(--gold);
  margin-bottom: 0.2rem;
  font-family: var(--font-serif);
}

.lux-welcome {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--white-40);
}

.lux-welcome-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.lux-welcome p {
  font-size: 0.85rem;
  line-height: 1.8;
}

/* Login Prompt */
.lux-login-prompt {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-card);
  border-radius: 12px;
  margin: 0.5rem 0;
}

.lux-login-prompt p {
  font-size: 0.85rem;
  color: var(--white-50);
  margin-bottom: 1rem;
}

.lux-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.5rem;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--space-deep);
  border: none;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.lux-login-btn:hover {
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
  transform: translateY(-1px);
}

/* Panel Footer */
.lux-panel-footer {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--white-05);
}

/* Tip Section */
.lux-tip-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  margin-bottom: 0.5rem;
}

.lux-tip-label {
  font-size: 0.75rem;
  color: var(--white-30);
}

.lux-tip-amounts {
  display: flex;
  gap: 0.4rem;
}

.lux-tip-btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.7rem;
  color: var(--white-50);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.lux-tip-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.lux-tip-btn.active {
  background: var(--gold-glow);
  border-color: var(--gold);
  color: var(--gold);
}

/* Input Area */
.lux-input-area {
  display: flex;
  gap: 0.5rem;
}

.lux-input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  background: var(--white-05);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  color: var(--white);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  resize: none;
  min-height: 40px;
  max-height: 100px;
}

.lux-input:focus {
  border-color: var(--gold);
  background: var(--white-08);
}

.lux-input::placeholder {
  color: var(--white-20);
}

.lux-send {
  width: 40px;
  height: 40px;
  border: none;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-radius: 50%;
  color: var(--space-deep);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lux-send:hover {
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
  transform: scale(1.05);
}

.lux-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* User Info Bar */
.lux-user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--white-05);
  margin-bottom: 0.5rem;
}

.lux-user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lux-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--space-lighter);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.lux-user-name {
  font-size: 0.8rem;
  color: var(--white);
}

.lux-user-lux {
  font-size: 0.7rem;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.lux-logout-btn {
  font-size: 0.7rem;
  color: var(--white-30);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
}

.lux-logout-btn:hover {
  color: var(--white-50);
}

/* Typing Indicator */
.lux-typing {
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0;
  color: var(--white-30);
  font-size: 0.75rem;
}

.lux-typing.show {
  display: flex;
}

.lux-typing-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  animation: typing-bounce 1.4s ease-in-out infinite;
}

.lux-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.lux-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-4px); }
}

/* Mobile */
@media (max-width: 480px) {
  .floating-lux {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 50px;
    height: 50px;
  }
  
  .lux-panel {
    bottom: 5rem;
    right: 1rem;
    left: 1rem;
    width: auto;
    max-width: none;
  }
}
