/* components.css - 共享组件样式（TabBar、Toast、Modal、ActionSheet） */

/* ============ TabBar ============ */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: rgba(20, 10, 30, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.4);
  z-index: 999;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
}
.tabbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  position: relative;
  transition: transform 0.2s;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tabbar-item:active { transform: scale(0.92); }
.tabbar-icon { font-size: 22px; margin-bottom: 2px; }
.tabbar-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}
.tabbar-item.tabbar-active .tabbar-label {
  color: var(--primary);
  font-weight: 700;
}
.tabbar-item.tabbar-active .tabbar-icon {
  transform: scale(1.15);
}

/* ============ Toast ============ */
.toast-container {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  pointer-events: none;
}
.toast-box {
  background: rgba(0, 0, 0, 0.75);
  border-radius: 12px;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 200px;
}
.toast-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.toast-icon-error { background: var(--danger); }
.toast-loading {
  background: transparent;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
.toast-text {
  font-size: 13px;
  color: #fff;
  text-align: center;
  word-break: break-all;
}

/* ============ Modal ============ */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}
.modal-box {
  background: #fff;
  border-radius: 16px;
  width: 280px;
  max-width: 85vw;
  overflow: hidden;
  animation: modalIn 0.2s ease-out;
}
@keyframes modalIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #333;
  text-align: center;
  padding: 20px 16px 8px;
}
.modal-content-text {
  font-size: 14px;
  color: #666;
  text-align: center;
  padding: 0 16px 20px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.modal-buttons {
  display: flex;
  border-top: 1px solid #eee;
}
.modal-btn {
  flex: 1;
  height: 48px;
  border: none;
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  -webkit-appearance: none;
}
.modal-btn-cancel {
  color: #666;
  border-right: 1px solid #eee;
}
.modal-btn-confirm {
  color: var(--primary);
  font-weight: 700;
}

/* ============ ActionSheet ============ */
.actionsheet-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9997;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.actionsheet-box {
  width: 100%;
  max-width: 500px;
  animation: slideUp 0.3s ease-out;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.actionsheet-list {
  background: #fff;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}
.actionsheet-item {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}
.actionsheet-item:active { background: #f5f5f5; }
.actionsheet-cancel {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #999;
  background: #fff;
  margin-top: 8px;
  border-radius: 12px;
  cursor: pointer;
}

/* ============ 图片预览 ============ */
.image-preview-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.image-preview-counter {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.8);
  font-size: 14px;
}

/* ============ 导航栏 ============ */
.nav-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 44px;
  background: rgba(10, 6, 18, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  padding: 0 12px;
  z-index: 200;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.nav-bar-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.nav-bar-back {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
}
.nav-bar-back:active { background: rgba(255,255,255,0.1); }

/* ============ 页面头部 ============ */
.page-header {
  padding-top: 44px;
}
.page-header-spacer { height: 44px; }
