/* 顶部导航样式 */
.topbar-wrap {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  background: var(--panel) !important;
  border-bottom: 1px solid var(--panel-border) !important;
}

.topbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar .logo {
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  background: linear-gradient(135deg, #1a1411 0%, #3d3732 50%, #1a1411 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
  position: relative;
  display: inline-block;
}

.topbar .logo::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(196, 111, 84, 0.5));
  transition: width 0.3s ease;
}

.topbar .logo:hover {
  background-position: 100% 0;
  transform: translateY(-1px);
}

.topbar .logo:hover::after {
  width: 100%;
}

.topbar nav {
  display: flex;
  gap: 16px;
  align-items: center;
  flex: 1;
}

.topbar .nav-link {
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--text, #3d3732);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  border: none;
  outline: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  display: inline-flex;
  align-items: center;
}

.topbar .nav-link::before {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 2px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 使用变量以适配主题，无变量时保持温暖风悬浮色 */
.topbar .nav-link:hover {
  background: var(--input-bg, rgba(196, 111, 84, 0.08));
  color: var(--accent);
  transform: translateY(-1px);
  font-weight: 700;
}

.topbar .nav-link:hover::before {
  transform: translateX(-50%) scaleX(1);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  border: none;
  outline: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

.nav-dropdown-arrow {
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
  display: inline-block;
}

.user-center-wrapper:hover .nav-dropdown-arrow,
.user-center-wrapper.menu-open .nav-dropdown-arrow,
.other-wrapper:hover .nav-dropdown-arrow,
.other-wrapper.menu-open .nav-dropdown-arrow {
  transform: rotate(180deg);
  color: var(--accent);
}

/* 使用变量以适配主题，无变量时保持温暖风浅色 */
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  min-width: 180px;
  background: var(--panel, rgba(249, 246, 241, 0.98));
  backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border, transparent);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.95);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
              visibility 0.25s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  overflow: hidden;
}

.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(196, 111, 84, 0.2), 
    transparent
  );
}

.nav-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.nav-dropdown-item {
  display: block;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  margin: 2px 0;
}

.nav-dropdown-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleX(0);
  width: 3px;
  height: 60%;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 使用变量以适配主题 */
.nav-dropdown-item:hover {
  background: var(--input-bg, linear-gradient(135deg, rgba(196, 111, 84, 0.1), rgba(196, 111, 84, 0.05)));
  color: var(--accent);
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(196, 111, 84, 0.15);
}

.nav-dropdown-item:hover::before {
  transform: translateY(-50%) scaleX(1);
}

.nav-dropdown-divider {
  height: 1px;
  background: rgba(228, 219, 208, 0.5);
  margin: 8px 6px;
  border-radius: 1px;
}

.topbar .top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 主题选择器样式 */
.theme-selector {
  position: relative;
  z-index: 10000;
  isolation: isolate;
}

.theme-selector-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  width: 40px;
  height: 40px;
}

.theme-selector-btn:hover {
  background: var(--input-bg);
  color: var(--accent);
  transform: translateY(-1px);
}

.theme-toggle-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  width: 40px;
  height: 40px;
}

.theme-toggle-btn:hover {
  background: var(--input-bg);
  color: var(--accent);
  transform: translateY(-1px);
}

/* 确保 topbar 内 Font Awesome 图标正常显示（不被主题或 body 字体覆盖） */
.topbar .fa,
.topbar i[class*="fa-"],
.topbar-wrap .fa,
.topbar-wrap i[class*="fa-"],
.theme-toggle-btn .fa,
.theme-toggle-btn i[class*="fa-"] {
  font-family: 'FontAwesome' !important;
  font-style: normal !important;
  font-weight: normal !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.theme-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 8px;
  min-width: 180px;
  z-index: 10001;
  isolation: isolate;
}

.theme-dropdown.hidden {
  display: none;
}

.theme-dropdown-header {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 4px;
}

.theme-option {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  background: transparent;
  border: none;
  text-align: left;
  font-size: 14px;
}

.theme-option:hover {
  background: var(--input-bg);
}

.theme-option.active {
  background: var(--accent);
  color: #fff;
}

.theme-option i:first-child {
  width: 18px;
  text-align: center;
  font-size: 16px;
}

.theme-option .theme-check {
  margin-left: auto;
  font-size: 12px;
}

.theme-option .theme-check.hidden {
  display: none;
}

.topbar .ghost-btn {
  padding: 10px 18px;
  border-radius: 12px;
  border: 1.5px solid var(--panel-border);
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-block;
  position: relative;
  overflow: hidden;
}

.topbar .ghost-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(196, 111, 84, 0.1), transparent);
  transition: left 0.5s ease;
}

.topbar .ghost-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(196, 111, 84, 0.2);
}

.topbar .ghost-btn:hover::before {
  left: 100%;
}

.topbar .solid-btn {
  padding: 11px 20px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--cta) 0%, #1a1a1a 100%);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  position: relative;
  overflow: hidden;
}

.topbar .solid-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.topbar .solid-btn:hover {
  background: linear-gradient(135deg, var(--cta-hover) 0%, #2a2a2a 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.15);
}

.topbar .solid-btn:hover::before {
  left: 100%;
}

/* 用户菜单样式 */
.user-menu-wrapper {
  position: relative;
}

.user-menu-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease;
  font-family: inherit;
}

.user-menu-button:hover {
  background: rgba(196, 111, 84, 0.12);
}

.user-avatar-img,
.user-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.user-avatar-img {
  object-fit: cover;
  border: 1px solid var(--panel-border);
}

.user-avatar-placeholder {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.user-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.user-menu-arrow {
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.2s ease, color 0.2s ease;
  line-height: 1;
}

.user-menu-button:hover .user-menu-arrow {
  color: var(--accent);
}

/* 下拉菜单样式 */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  isolation: isolate;
}

.user-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  text-align: center;
  font-family: inherit;
}

.user-dropdown-item:hover {
  background: rgba(196, 111, 84, 0.12);
  color: var(--accent);
}

.user-dropdown-item.logout-item {
  color: #e24c45;
}

.user-dropdown-item.logout-item:hover {
  background: rgba(226, 76, 69, 0.12);
  color: #c4352e;
}


/* 手机端菜单按钮 */
.mobile-menu-button {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s ease;
  margin-left: auto;
}

/* Transfer侧栏切换按钮（移动端） */
.mobile-sidebar-toggle-button {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s ease;
  margin-left: 8px;
}

.mobile-menu-button:hover {
  background: rgba(196, 111, 84, 0.1);
}

.mobile-sidebar-toggle-button:hover {
  background: rgba(196, 111, 84, 0.1);
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 24px;
  height: 18px;
  position: relative;
}

.hamburger-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.hamburger-icon.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger-icon.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger-icon.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* 手机端侧栏遮罩 */
.mobile-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* 使用动态视口高度，适配移动浏览器 */
  min-height: 100vh;
  min-height: 100dvh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99998 !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  /* 阻止触摸事件穿透 */
  touch-action: none;
  -webkit-overflow-scrolling: touch;
  /* 确保覆盖所有内容 */
  pointer-events: auto;
  /* 确保在最上层 */
  isolation: isolate;
}

.mobile-sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* 手机端侧栏 */
.mobile-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 85%;
  max-width: 320px;
  height: 100vh;
  height: 100dvh; /* 使用动态视口高度，适配移动浏览器 */
  min-height: 100vh;
  min-height: 100dvh;
  background: rgba(251, 250, 247, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  z-index: 99999 !important;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  flex-direction: column;
  /* 阻止触摸事件穿透 */
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  /* 确保在最上层 */
  pointer-events: auto;
  /* 确保在最上层 */
  isolation: isolate;
}

.mobile-sidebar.show {
  transform: translateX(0);
}

.mobile-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid rgba(228, 219, 208, 0.7);
  flex-shrink: 0;
}

.mobile-logo {
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  background: linear-gradient(135deg, #1a1411 0%, #3d3732 50%, #1a1411 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mobile-close-button {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 24px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease;
  font-family: inherit;
}

.mobile-close-button:hover {
  background: rgba(196, 111, 84, 0.1);
}

.mobile-nav {
  flex: 1;
  padding: 20px 0;
  overflow-y: auto;
}

.mobile-nav-link {
  display: block;
  padding: 16px 20px;
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
  background: rgba(196, 111, 84, 0.08);
  color: var(--accent);
  border-left-color: var(--accent);
}

.mobile-nav-section {
  margin-top: 3px;
  padding-top: 3px;
  /* border-top: 1px solid rgba(228, 219, 208, 0.5); */
}

.mobile-nav-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.mobile-nav-section-title {
  padding: 0 20px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mobile-nav-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin: 0;
}

.mobile-nav-section-toggle:hover {
  background: rgba(196, 111, 84, 0.08);
  color: var(--accent);
}

.mobile-nav-section-toggle span:first-child {
  flex: 1;
  text-align: left;
}

.mobile-nav-arrow {
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
  display: inline-block;
  margin-left: 8px;
}

.mobile-nav-arrow.active {
  transform: rotate(180deg);
  color: var(--accent);
}

.mobile-nav-section-toggle:hover .mobile-nav-arrow {
  color: var(--accent);
}

.mobile-nav-section-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
  visibility: hidden;
}

.mobile-nav-section-content.show {
  max-height: 500px;
  opacity: 1;
  padding: 0;
  visibility: visible;
}

.mobile-nav-section-content .mobile-nav-link {
  padding-left: 20px;
  padding-right: 20px;
}

.mobile-actions {
  padding: 20px;
  border-top: 1px solid rgba(228, 219, 208, 0.7);
  flex-shrink: 0;
}

.mobile-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--panel);
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--panel-border);
}

.mobile-user-avatar-wrapper {
  flex-shrink: 0;
}

.mobile-user-avatar,
.mobile-user-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.mobile-user-avatar {
  object-fit: cover;
  border: 2px solid var(--panel-border);
}

.mobile-user-avatar-placeholder {
  background: var(--panel);
  border: 2px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.mobile-user-details {
  flex: 1;
  min-width: 0;
}

.mobile-user-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-user-email {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-action-btn {
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  display: block;
}

.mobile-action-btn-primary {
  background: linear-gradient(135deg, var(--cta) 0%, #1a1a1a 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.mobile-action-btn-primary:hover {
  background: linear-gradient(135deg, var(--cta-hover) 0%, #2a2a2a 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.mobile-action-btn-secondary {
  background: var(--panel);
  color: var(--text);
  border: 1.5px solid var(--panel-border);
}

.mobile-action-btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(196, 111, 84, 0.08);
}

.mobile-action-btn-danger {
  background: transparent;
  color: #e24c45;
  border: 1.5px solid rgba(226, 76, 69, 0.3);
}

.mobile-action-btn-danger:hover {
  background: rgba(226, 76, 69, 0.12);
  border-color: #e24c45;
  color: #c4352e;
}

/* 响应式 */
@media (max-width: 1024px) {
  .topbar {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  /* 隐藏桌面端导航和操作按钮 */
  .desktop-nav,
  .desktop-actions,
  .topbar nav,
  .topbar .top-actions {
    display: none !important;
  }

  /* 显示手机端菜单按钮 */
  .mobile-menu-button {
    display: flex;
    margin-left: auto;
    flex-shrink: 0;
  }

  /* 显示Transfer侧栏切换按钮（在transmit页面） */
  .mobile-sidebar-toggle-button {
    display: flex;
    flex-shrink: 0;
  }

  /* 显示手机端侧栏 */
  .mobile-sidebar-overlay {
    display: block;
  }

  .mobile-sidebar {
    display: flex;
  }

  /* 调整顶栏布局 - 更紧凑，只显示logo和菜单按钮 */
  .topbar {
    padding: 10px 16px;
    min-height: 56px;
    max-height: 56px;
    justify-content: space-between;
    align-items: center;
    gap: 0;
  }

  .topbar .logo {
    font-size: 18px;
    flex-shrink: 0;
    margin: 0;
  }

  /* 确保顶栏只显示logo和菜单按钮 */
  .topbar > *:not(.logo):not(.mobile-menu-button):not(.mobile-sidebar-toggle-button) {
    display: none !important;
  }

  /* 顶栏包装器更紧凑 */
  .topbar-wrap {
    border-bottom: 1px solid rgba(228, 219, 208, 0.7);
  }
}

/* Dark模式下的导航栏样式 */
.dark .topbar-wrap {
  background: var(--panel) !important;
  border-bottom: 1px solid var(--panel-border) !important;
}

.dark .topbar .logo {
  background: linear-gradient(135deg, #ffffff 0%, #e5e7eb 50%, #ffffff 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: brightness(1.1);
  background-color: transparent !important;
}

.dark .topbar .nav-link {
  color: var(--text) !important;
}

.dark .topbar .nav-link:hover {
  background: rgba(var(--accent-rgb), 0.15) !important;
  color: var(--accent) !important;
}

.dark .nav-dropdown-menu {
  background: var(--panel, #1f2937); /* 有 --panel 时用主题色，否则 gray-800 */
  border: 1px solid var(--panel-border, rgba(55, 65, 81, 0.8));
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.dark .nav-dropdown-item {
  color: #d1d5db; /* gray-300 */
}

.dark .nav-dropdown-item:hover {
  background: rgba(217, 119, 87, 0.15); /* primary-color with transparency */
  color: rgb(217, 119, 87); /* primary-color */
}

.dark .user-menu-button {
  color: #d1d5db; /* gray-300 */
}

.dark .user-dropdown-menu,
.dark .user-dropdown-menu.show {
  background: #1f2937; /* gray-800 */
  border: 1px solid rgba(55, 65, 81, 0.8); /* gray-700 */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.dark .user-dropdown-item {
  color: #d1d5db; /* gray-300 */
}

.dark .user-dropdown-item:hover {
  background: rgba(217, 119, 87, 0.15); /* primary-color with transparency */
  color: rgb(217, 119, 87); /* primary-color */
}

.dark .mobile-sidebar {
  background: rgba(31, 41, 55, 0.98); /* gray-800 with transparency */
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
}

.dark .mobile-sidebar-header {
  border-bottom: 1px solid rgba(55, 65, 81, 0.7); /* gray-700 */
}

.dark .mobile-logo {
  background: linear-gradient(135deg, #f9fafb 0%, #d1d5db 50%, #f9fafb 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-color: transparent !important;
}

.dark .mobile-nav-link {
  color: #d1d5db; /* gray-300 */
}

.dark .mobile-nav-link:hover,
.dark .mobile-nav-link:active {
  background: rgba(217, 119, 87, 0.15); /* primary-color with transparency */
  color: rgb(217, 119, 87); /* primary-color */
}

.dark .mobile-nav-section-title {
  color: #d1d5db; /* gray-300 */
}

.dark .mobile-user-info {
  color: #d1d5db; /* gray-300 */
}

.dark .mobile-user-name {
  color: #f9fafb; /* gray-50 */
}

.dark .mobile-user-email {
  color: #9ca3af; /* gray-400 */
}

.dark .mobile-action-btn {
  color: #d1d5db; /* gray-300 */
}

.dark .mobile-action-btn-primary {
  background: linear-gradient(135deg, var(--cta) 0%, #1a1a1a 100%);
  color: #fff;
}

.dark .mobile-action-btn-secondary {
  background: var(--panel);
  border: 1.5px solid var(--panel-border);
  color: var(--text);
}

.dark .theme-dropdown {
  background: #1f2937; /* gray-800 */
  border: 1px solid rgba(55, 65, 81, 0.8); /* gray-700 */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.dark .nav-dropdown-divider {
  background: rgba(55, 65, 81, 0.5); /* gray-700 */
}

