header.topbar {
  background: #fff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 4000 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
  padding: 0 !important;
  margin: 0 !important;
  height: auto !important;
  margin-bottom: 10px !important;
}

.topbar,
.topbar * {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.topbar .inner {
  max-width: none !important;
  margin: 0 !important;
  padding: 6px 16px !important;
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  gap: 24px !important;
  height: auto !important;
  min-height: 40px !important;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.topbar .brand {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary, #007aff);
  text-decoration: none;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.topnav a {
  color: #64748b;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.topnav a:hover {
  color: var(--primary, #007aff);
}

.topnav a.active {
  color: var(--primary, #007aff);
  font-weight: 600;
}

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

.search-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 3px;
  border: 1px solid rgba(60, 60, 67, 0.14);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  min-width: 0;
  width: clamp(340px, 38vw, 520px);
  max-width: 520px;
}

.search-bar:focus-within {
  border-color: rgba(0, 122, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12), 0 1px 2px rgba(15, 23, 42, 0.04);
}

.search-bar .region-selector {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.search-bar .rs-trigger {
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0 10px;
  height: 34px;
  border-radius: 11px;
  user-select: none;
  transition: background 0.15s;
}

.search-bar .rs-trigger:hover {
  background: rgba(15, 23, 42, 0.04);
}

.search-bar .rs-trigger:active {
  background: rgba(15, 23, 42, 0.06);
}

.search-bar .rs-trigger .flag {
  font-size: 18px;
}

.search-bar .rs-trigger .label {
  font-size: 13px;
}

.search-bar select {
  min-width: 60px;
  font-weight: 500;
  padding: 0 12px;
  border: none;
  border-left: 1px solid rgba(60, 60, 67, 0.12);
  background: transparent;
  outline: none;
  font-size: 13px;
  color: #0f172a;
  appearance: none;
  background-image: none;
  height: 34px;
}

.search-bar select:disabled {
  color: #94a3b8;
  background: transparent;
  cursor: default;
}

.search-bar input {
  flex: 1;
  min-width: 160px;
  border: none;
  border-left: 1px solid rgba(60, 60, 67, 0.12);
  background: transparent;
  outline: none;
  font-size: 13px;
  color: #0f172a;
  height: 34px;
  padding: 0 12px;
}

.search-bar input::placeholder {
  color: #94a3b8;
}

.search-bar button {
  border: none;
  background: transparent;
  color: #64748b;
  height: 34px;
  padding: 0 12px;
  border-left: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 0 11px 11px 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.search-bar button:hover {
  background: rgba(15, 23, 42, 0.04);
  color: #334155;
}

.search-bar button:active {
  background: rgba(15, 23, 42, 0.06);
}

.search-bar button:focus-visible {
  outline: none;
}

/* 平台切换按钮 */
.platform-switch-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #64748b;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s;
  margin-left: 8px;
}

.platform-switch-btn:hover {
  color: #334155;
  background: rgba(15, 23, 42, 0.04);
}

.platform-switch-btn svg {
  flex-shrink: 0;
}

/* 用户入口 */
.user-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 10px;
  transition: background 0.2s;
  cursor: pointer;
  margin-left: 8px;
}

.user-entry:hover {
  background: rgba(15, 23, 42, 0.04);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.user-role {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
}

/* 用户下拉菜单 */
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.05);
  min-width: 140px;
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.2s ease;
  z-index: 2000;
}

.user-entry {
  position: relative;
}

.user-entry:hover .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  color: #333;
  font-size: 14px;
  text-decoration: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.user-dropdown-item:hover {
  background: #f5f5f5;
}

.user-dropdown-item svg {
  color: #666;
  flex-shrink: 0;
}
