/* ─── TabBar 组件 ─── */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--tabbar-height);
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 500;
  box-shadow: 0 -2rem 12rem rgba(0,0,0,0.08);
  padding-bottom: var(--safe-bottom);
  border-top: 1rem solid rgba(0,0,0,0.05);
}

.tabbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  padding: 8rem 0;
  transition: all 0.2s ease;
}

.tabbar-item:active {
  opacity: 0.7;
}

.tabbar-icon {
  width: 48rem;
  height: 48rem;
  margin-bottom: 4rem;
}

.tabbar-text {
  font-size: 20rem;
  color: #999999;
  letter-spacing: 1rem;
  transition: color 0.2s ease;
}

.tabbar-item.active .tabbar-text {
  color: var(--color-primary-dark);
  font-weight: 600;
}

/* ─── Toast 组件 ─── */
.toast-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  pointer-events: none;
}

.toast-content {
  background: rgba(0, 0, 0, 0.75);
  color: #FFFFFF;
  font-size: 28rem;
  padding: 20rem 40rem;
  border-radius: 16rem;
  text-align: center;
  max-width: 500rem;
  letter-spacing: 1rem;
  animation: toastFadeIn 0.3s ease;
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes toastFadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.8); }
}

/* ─── 图片预览组件 ─── */
.preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}

.preview-image {
  max-width: 95%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8rem;
}

.preview-close {
  position: absolute;
  top: 40rem;
  right: 30rem;
  width: 60rem;
  height: 60rem;
  font-size: 36rem;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ─── 通用 Loading ─── */
.loading-spinner {
  width: 80rem;
  height: 80rem;
  border: 6rem solid rgba(129, 199, 132, 0.3);
  border-top-color: #66BB6A;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
