/* ── 液态玻璃（Liquid Glass）底部 Dock 栏 ── */
:root {
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-border: rgba(255, 255, 255, 0.35);
  --glass-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6), 
                  inset 0 -1px 1px rgba(0, 0, 0, 0.05),
                  0 8px 32px rgba(0, 0, 0, 0.08);
}

.mdui-theme-dark {
  --glass-bg: rgba(26, 26, 36, 0.5);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15), 
                  inset 0 -1px 1px rgba(0, 0, 0, 0.2),
                  0 8px 32px rgba(0, 0, 0, 0.3);
}

.sb-bottom-bar {
  position: fixed !important;
  left: auto !important;
  right: 20px !important;
  bottom: 16px !important;
  transform: none !important;
  width: fit-content !important;
  border-radius: 24px !important;
  height: 72px !important;
  padding: 0 20px !important;
  display: inline-flex !important;
  align-items: center !important;
  
  background-color: var(--glass-bg) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: var(--glass-shadow) !important;
  
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  z-index: 100 !important;
  overflow: visible !important;
  contain: none !important;
  --mdui-color-surface-container: transparent;
  --mdui-color-surface: transparent;
  
  pointer-events: none !important; /* 允许透明区域穿透点击 */
}

/* 允许底部栏内的交互元素正常接收点击和悬浮事件 */
.sb-bottom-bar mdui-button-icon,
.sb-bottom-bar .bottom-nav-item,
.sb-bottom-bar .bottom-account-container,
.sb-bottom-bar mdui-tooltip {
  pointer-events: auto !important;
}

/* 按钮在玻璃栏上的光影效果优化 */
.sb-bottom-bar mdui-button-icon {
  transition: transform 0.2s, background-color 0.2s !important;
}

.sb-bottom-bar mdui-button-icon:hover {
  transform: scale(1.06);
}

.sb-bottom-bar mdui-button-icon:active {
  transform: scale(0.96);
}

/* ── 底部应用栏账户区域 ── */
.bottom-account-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px 4px 16px;
  margin-right: 8px;
  border-radius: 28px;
  transition: background-color 0.2s ease, transform 0.1s ease;
  user-select: none;
}

.bottom-account-container:hover {
  background-color: rgba(var(--mdui-color-on-surface-variant), 0.08);
}

.bottom-account-container:active {
  background-color: rgba(var(--mdui-color-on-surface-variant), 0.16);
  transform: scale(0.98);
}

.bottom-account-name {
  font-size: 14px;
  font-weight: 500;
  color: rgb(var(--mdui-color-on-surface-variant));
  white-space: nowrap;
  transition: color 0.2s ease;
}

.bottom-account-container:hover .bottom-account-name {
  color: rgb(var(--mdui-color-on-surface));
}

.bottom-account-btn {
  margin: 0 !important;
  pointer-events: none;
}

.bottom-account-name-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bottom-account-provider-inline {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bottom-account-provider-inline img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  transition: filter 0.2s ease;
}

.mdui-theme-dark .bottom-account-provider-inline img {
  filter: brightness(0) invert(1);
}

@media (prefers-color-scheme: dark) {
  .mdui-theme-auto .bottom-account-provider-inline img {
    filter: brightness(0) invert(1);
  }
}

.bottom-account-provider-inline--text {
  font-size: 10px;
  font-weight: 700;
  color: rgb(var(--mdui-color-on-surface));
}

/* 已登录头像图标样式 */
.avatar-button-logged {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.user-avatar-initial {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: rgb(var(--mdui-color-primary));
  color: rgb(var(--mdui-color-on-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}

.user-avatar-initial:hover {
  transform: scale(1.08);
}

/* 用户头像图片 */
.user-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}

.user-avatar-img:hover {
  transform: scale(1.08);
}

/* ── 导航项文本及布局 (垂直排列) ── */
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 16px;
  height: 58px;
  min-width: 64px;
  transition: all 0.2s ease;
  user-select: none;
}

.bottom-nav-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 28px;
  border-radius: 14px;
  transition: background-color 0.2s, transform 0.1s, color 0.2s;
  color: rgb(var(--mdui-color-on-surface-variant));
}

.bottom-nav-item:hover .bottom-nav-icon-wrapper {
  background-color: rgba(var(--mdui-color-on-surface-variant), 0.08);
  color: rgb(var(--mdui-color-on-surface));
}

.bottom-nav-item.active .bottom-nav-icon-wrapper {
  background-color: rgb(var(--mdui-color-primary-container));
  color: rgb(var(--mdui-color-on-primary-container));
}

.bottom-nav-label {
  font-size: 10px;
  font-weight: 500;
  margin-top: 4px;
  color: rgb(var(--mdui-color-on-surface-variant));
  transition: color 0.2s, font-weight 0.2s;
  white-space: nowrap;
}

.bottom-nav-item:hover .bottom-nav-label {
  color: rgb(var(--mdui-color-on-surface));
}

.bottom-nav-item.active .bottom-nav-label {
  color: rgb(var(--mdui-color-primary));
  font-weight: 600;
}

.bottom-nav-item--success .bottom-nav-icon-wrapper {
  background-color: rgba(46, 125, 50, 0.14);
  color: rgb(46, 125, 50);
}

.bottom-nav-item--success .bottom-nav-label {
  color: rgb(46, 125, 50);
  font-weight: 600;
}

.bottom-nav-item--success:hover .bottom-nav-icon-wrapper {
  background-color: rgba(46, 125, 50, 0.2);
  color: rgb(27, 94, 32);
}

.bottom-nav-item--success:hover .bottom-nav-label {
  color: rgb(27, 94, 32);
}

.bottom-nav-item--success.active .bottom-nav-icon-wrapper {
  background-color: rgba(46, 125, 50, 0.22);
  color: rgb(27, 94, 32);
}

.bottom-nav-item--success.active .bottom-nav-label {
  color: rgb(27, 94, 32);
}

/* 缩小版的中间留空 */
.bottom-bar-spacer {
  width: 24px;
  height: 100%;
}

/* ── Electron 客户端定制悬浮头像（右下角圆形按钮） ── */
.sb-bottom-bar.electron-mode {
  left: auto !important;
  right: 20px !important;
  transform: none !important;
  width: fit-content !important;
  height: 72px !important;
  padding: 0 20px !important;
  border-radius: 24px !important;
  justify-content: flex-start !important;
  display: inline-flex !important;
}

.sb-bottom-bar.electron-mode .bottom-account-container {
  padding: 4px 8px 4px 16px !important;
  margin-right: 8px !important;
  width: auto !important;
  height: auto !important;
  justify-content: flex-start !important;
  border-radius: 28px !important;
}

.sb-bottom-bar.electron-mode .bottom-account-btn {
  margin: 0 !important;
}

/* Auto Join Fab Custom Styles */
.bottom-fabs-container {
  position: fixed;
  right: 32px;
  bottom: 104px;
  z-index: 110;
  display: flex;
  flex-direction: row-reverse; /* right-to-left: + is rightmost, filter is next, auto-join is leftmost */
  align-items: center;
  gap: 18px;
  pointer-events: none;
}

.custom-server-fab-wrapper,
.auto-join-fab-wrapper,
.filter-empty-fab-wrapper,
.download-client-fab-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.bottom-fab-tooltip {
  position: absolute;
  right: 50%;
  bottom: calc(100% + 12px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: max-content;
  max-width: min(260px, calc(100vw - 32px));
  padding: 12px 16px;
  box-sizing: border-box;
  border-radius: 16px;
  background: rgb(var(--mdui-color-surface-container-highest));
  color: rgb(var(--mdui-color-on-surface));
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms;
}

.bottom-fab-tooltip strong {
  font-size: 16px;
  line-height: 1.35;
}

.bottom-fab-tooltip span {
  font-size: 14px;
  line-height: 1.45;
  white-space: normal;
}

.custom-server-fab-wrapper:hover .bottom-fab-tooltip,
.filter-empty-fab-wrapper:hover .bottom-fab-tooltip,
.download-client-fab-wrapper:hover .bottom-fab-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.custom-server-fab-wrapper {
  width: 64px;
  height: 64px;
}

.auto-join-fab-wrapper {
  height: 64px;
  width: fit-content;
}

.filter-empty-fab-wrapper {
  width: 64px;
  height: 64px;
}

.download-client-fab-wrapper {
  height: 64px;
  width: fit-content;
}

.download-client-fab {
  height: 64px;
  color: #fff;
  background-color: #4caf50;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.download-client-fab:hover {
  background-color: #43a047;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.5);
}

.download-client-fab:active {
  background-color: #388e3c;
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.custom-server-fab {
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgb(var(--mdui-color-on-primary-container));
  background-color: rgb(var(--mdui-color-primary-container));
}

.custom-server-fab:hover {
  transform: translateY(-2px);
}

.filter-empty-fab {
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgb(var(--mdui-color-on-surface-variant));
  background-color: rgb(var(--mdui-color-surface-container-high));
  transition: all 0.2s ease, transform 0.1s ease;
}

.filter-empty-fab.filter-active {
  color: rgb(var(--mdui-color-primary));
  background-color: rgb(var(--mdui-color-primary-container));
}

.filter-empty-fab:hover {
  transform: translateY(-2px);
}

.custom-server-fab::part(button),
.filter-empty-fab::part(button) {
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-server-fab::part(label),
.filter-empty-fab::part(label) {
  display: none;
}

.custom-server-fab::part(icon),
.filter-empty-fab::part(icon) {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  line-height: 1;
  transform: translateY(0);
}

.bottom-fab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 24px;
  line-height: 1;
  transform: translateY(0);
}

@media (max-width: 600px) {
  .bottom-fabs-container {
    right: 16px;
    bottom: 96px;
    gap: 14px;
  }
}

.auto-join-pulse-ring {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 16px;
  z-index: -1;
  pointer-events: none;
}
.success-pulse {
  border: 3px solid #4caf50;
  animation: ring-pulse-green 1.5s infinite cubic-bezier(0.2, 0, 0.2, 1);
}
.running-pulse {
  border: 3px solid rgb(var(--mdui-color-primary, 103, 80, 164));
  animation: ring-pulse-primary 1.5s infinite cubic-bezier(0.2, 0, 0.2, 1);
}
.auto-join-running-fab {
  pointer-events: auto;
  height: 64px;
}
.auto-join-running-fab:hover {
  transform: translateY(-2px);
}
.auto-join-running-fab:active {
  transform: translateY(0);
}
.auto-join-running-fab__text {
  display: inline-block;
  min-width: 80px;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}
@keyframes ring-pulse-green {
  0% { transform: scale(1); opacity: 0.8; border-width: 3px; }
  100% { transform: scale(1.15, 1.4); opacity: 0; border-width: 0px; }
}
@keyframes ring-pulse-primary {
  0% { transform: scale(1); opacity: 0.8; border-width: 3px; }
  100% { transform: scale(1.15, 1.4); opacity: 0; border-width: 0px; }
}

/* Fab Fade Transition */
.fab-fade-enter-active,
.fab-fade-leave-active {
  transition: opacity 0.3s cubic-bezier(0.2, 0, 0, 1), transform 0.3s cubic-bezier(0.2, 0, 0, 1);
}
.fab-fade-enter-from,
.fab-fade-leave-to {
  opacity: 0;
  transform: translateY(16px) scale(0.95);
}
.fab-copy-enter-active,
.fab-copy-leave-active {
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.fab-copy-enter-from,
.fab-copy-leave-to {
  opacity: 0;
  transform: translateY(8px);
}

/* Fab Text Fade Transition */
.fab-text-fade-enter-active,
.fab-text-fade-leave-active {
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.fab-text-fade-enter-from,
.fab-text-fade-leave-to {
  opacity: 0;
  transform: translateY(4px);
}

/* Success Button Hover Effects */
.auto-join-success-btn {
  background-color: #4caf50 !important;
  color: #fff !important;
  height: 64px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 26px;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.auto-join-success-btn__label {
  font-weight: 500;
  font-size: 15px;
}
.auto-join-success-btn:hover {
  background-color: #43a047 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.5);
}
.auto-join-success-btn:active {
  background-color: #388e3c !important;
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}
