/* === 车机壁纸 - 组件样式 === */

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { opacity: 0.9; }

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}
.btn-lg {
  padding: 14px 32px;
  font-size: 16px;
}

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Toast 通知 */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  min-width: 280px;
  max-width: 400px;
  animation: slideInRight 0.3s ease;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-success {
  background: rgba(34, 197, 94, 0.9);
  color: white;
}
.toast-error {
  background: rgba(239, 68, 68, 0.9);
  color: white;
}
.toast-info {
  background: rgba(59, 130, 246, 0.9);
  color: white;
}
.toast-warning {
  background: rgba(245, 158, 11, 0.9);
  color: white;
}

.toast-fade-out {
  animation: fadeOut 0.3s ease forwards;
}

/* 灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.lightbox-content {
  position: relative;
  max-width: 95vw;
  max-height: 90vh;
}

.lightbox-image {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

.lightbox-info {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  padding: 16px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: white;
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.lightbox-title {
  font-size: 15px;
  font-weight: 500;
}

.lightbox-meta {
  font-size: 12px;
  opacity: 0.75;
}

.lightbox-actions {
  display: flex;
  gap: 8px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space);
  color: var(--text-secondary);
}
.empty-state svg {
  width: 64px; height: 64px;
  margin-bottom: 16px;
  opacity: 0.3;
}
.empty-state h3 {
  margin-bottom: 8px;
  color: var(--text-primary);
}
.empty-state p {
  max-width: 400px;
  margin: 0 auto;
  font-size: 14px;
}

/* 加载骨架屏 */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 加载更多 */
.load-more {
  text-align: center;
  padding: var(--space-lg) 0;
}

/* 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}

.badge-success {
  background: rgba(34,197,94,0.1);
  color: var(--success);
}

.badge-warning {
  background: rgba(245,158,11,0.1);
  color: var(--warning);
}

/* 下拉菜单 */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  z-index: 200;
  display: none;
  animation: scaleIn 0.15s ease;
}

.dropdown-menu.show { display: block; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition-fast);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.dropdown-item:hover { background: var(--bg-hover); }

/* FAB 悬浮按钮 */
.fab {
  display: none;
}
@media (max-width: 640px) {
  .fab {
    display: flex;
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 20px);
    right: 16px;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 16px rgba(99,102,241,0.4);
    align-items: center;
    justify-content: center;
    z-index: 90;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 20px;
  }
  .fab:active { transform: scale(0.9); }
}

/* 智能屏幕居中气泡 */
.smart-bubble {
  position: fixed;
  left: 50%; bottom: 80px;
  transform: translateX(-50%) translateY(100px);
  display: flex; align-items: center; gap: 6px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 28px; padding: 6px;
  box-shadow: var(--shadow-lg);
  z-index: 95;
  opacity: 0; pointer-events: none;
  transition: all 0.35s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}
.smart-bubble.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1; pointer-events: auto;
}
.bubble-item {
  width: 40px; height: 40px; border-radius: 50%;
  border: none; background: transparent;
  color: var(--text-secondary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.bubble-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.bubble-item.bubble-main {
  width: 48px; height: 48px;
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}
.bubble-item.bubble-main:hover { background: var(--primary-hover); }

@media (max-width: 640px) {
  .smart-bubble { bottom: calc(var(--bottom-nav-height) + 24px); }
}

/* 响应式 Toast */
@media (max-width: 640px) {
  .toast-container { right: 12px; left: 12px; top: auto; bottom: calc(var(--bottom-nav-height) + 12px); }
  .toast { min-width: auto; max-width: 100%; }
}
