/* ============================================================
   统一生成按钮组件（点数标签 + 生成按钮）
   用法：<div id="genBtnContainer"></div>
        renderGenBtn('llm', 'genBtnContainer', generateClick, '生成音乐提示词')
   ============================================================ */

.gen-btn-group {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  vertical-align: middle;
}

.gen-btn-group:hover {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

/* 左侧点数标签 */
.gen-points {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 14px;
  background: rgba(124, 108, 246, 0.12);
  color: #a78bfa;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  border-right: 1px solid rgba(124, 108, 246, 0.2);
  user-select: none;
}

.gen-points svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  fill: #a78bfa;
}

.gen-points.free {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border-right-color: rgba(34, 197, 94, 0.2);
}

.gen-points.free svg {
  fill: #4ade80;
}

/* 右侧生成按钮 */
.gen-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  letter-spacing: 0.3px;
}

.gen-btn:hover {
  background: linear-gradient(135deg, #5558e3 0%, #7c3aed 100%);
}

.gen-btn:active {
  transform: scale(0.98);
}

.gen-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.gen-btn.loading {
  pointer-events: none;
  opacity: 0.85;
}

.gen-btn .gen-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gen-spin 0.7s linear infinite;
}

@keyframes gen-spin {
  to { transform: rotate(360deg); }
}

/* 点数不足状态 */
.gen-btn-group.insufficient .gen-points {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-right-color: rgba(239, 68, 68, 0.2);
}

.gen-btn-group.insufficient .gen-points svg {
  fill: #f87171;
}

/* ============================================================
   侧边栏点数显示条
   ============================================================ */

.sidebar-points {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin: 0 12px 8px;
  border-radius: 10px;
  background: rgba(124, 108, 246, 0.08);
  border: 1px solid rgba(124, 108, 246, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.sidebar-points:hover {
  background: rgba(124, 108, 246, 0.15);
  border-color: rgba(124, 108, 246, 0.4);
  transform: translateY(-1px);
}

.sidebar-points .sp-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-points .sp-icon svg {
  width: 20px;
  height: 20px;
  fill: #a78bfa;
}

.sidebar-points .sp-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-points .sp-label {
  font-size: 10px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sidebar-points .sp-value {
  font-size: 16px;
  font-weight: 800;
  color: #a78bfa;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

.sidebar-points .sp-value.decrease {
  color: #ef5350;
}

.sidebar-points .sp-value.increase {
  color: #4caf50;
}

/* 侧边栏收起状态：只显示图标 */
.sidebar.shrunk .sidebar-points {
  justify-content: center;
  padding: 10px 0;
  margin: 0 8px 8px;
}

.sidebar.shrunk .sidebar-points .sp-info {
  display: none;
}

/* 点数变化动画 */
@keyframes points-flash {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.sidebar-points.flash .sp-value {
  animation: points-flash 0.4s ease;
}
