:root {
  --sidebar-inset: 8px;
  --sidebar-panel-width: 257px;
  --sidebar-collapsed-panel-width: 56px;
  /* 主内容、顶栏和遮罩的占位包含侧栏左侧留白。 */
  --sidebar-width: calc(var(--sidebar-panel-width) + var(--sidebar-inset));
  --sidebar-collapsed-width: calc(var(--sidebar-collapsed-panel-width) + var(--sidebar-inset));
  --figma-sidebar-bg: #1d1d1f;
  --figma-sidebar-text: #f5f8ff;
  --figma-sidebar-secondary: #9fa6b2;
  --figma-sidebar-muted: #71767e;
}

/* 长短页面切换时保留滚动条槽位，避免顶栏发生横向位移。 */
html { scrollbar-gutter: stable; }

.figma-sidebar {
  top: var(--sidebar-inset);
  bottom: var(--sidebar-inset);
  left: var(--sidebar-inset);
  display: flex;
  width: var(--sidebar-panel-width);
  flex-direction: column;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: var(--figma-sidebar-bg);
  font-family: "Geist", "Noto Sans SC", ui-sans-serif, system-ui, sans-serif;
  transition: width 260ms cubic-bezier(.22, .8, .25, 1), border-radius 260ms cubic-bezier(.22, .8, .25, 1), transform 260ms ease;
}

.figma-sidebar ~ .main-content {
  transition: margin-left 260ms cubic-bezier(.22, .8, .25, 1);
}

.figma-sidebar ~ .main-content .top-bar {
  transition: left 260ms cubic-bezier(.22, .8, .25, 1);
}

.figma-sidebar.collapsed {
  width: var(--sidebar-collapsed-panel-width);
  border-radius: 47px;
}

.figma-sidebar .sidebar-top {
  display: flex;
  width: 100%;
  height: 56px;
  flex: 0 0 56px;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px 17px;
  transition: padding 260ms cubic-bezier(.22, .8, .25, 1);
}

.figma-sidebar .sidebar-header {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  color: var(--figma-sidebar-text);
  text-decoration: none;
  opacity: 1;
  transition: opacity 180ms ease;
}

.figma-sidebar .sidebar-logo {
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.figma-sidebar .sidebar-brand {
  color: var(--figma-sidebar-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  white-space: nowrap;
}

.figma-sidebar .sidebar-toggle {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
}

.figma-sidebar .sidebar-toggle:hover {
  border: 0;
  background: transparent;
  opacity: .82;
}

.figma-sidebar .sidebar-toggle img {
  display: block;
  width: 24px;
  height: 24px;
}

.figma-sidebar.collapsed .sidebar-top {
  position: relative;
  justify-content: space-between;
  padding: 15px 16px 17px;
}

.figma-sidebar.collapsed .sidebar-header {
  opacity: 0;
  pointer-events: none;
}

.figma-sidebar.collapsed .sidebar-toggle {
  position: static;
  transform: none;
}

.figma-sidebar.collapsed .sidebar-toggle img {
  transform: none;
}

.figma-sidebar .user-card {
  position: relative;
  width: calc(100% - 16px);
  margin: 15px 8px 0;
  padding: 0;
  flex: 0 0 64px;
  transition: width 260ms cubic-bezier(.22, .8, .25, 1), height 260ms cubic-bezier(.22, .8, .25, 1), flex-basis 260ms cubic-bezier(.22, .8, .25, 1);
}

.figma-sidebar .user-card-main {
  display: flex;
  width: 100%;
  height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 16px 9px 9px;
  border: 1px solid #2f2f31;
  border-radius: 10px;
  background: transparent;
  transition: width 260ms cubic-bezier(.22, .8, .25, 1), height 260ms cubic-bezier(.22, .8, .25, 1), padding 260ms cubic-bezier(.22, .8, .25, 1), gap 260ms cubic-bezier(.22, .8, .25, 1), border-radius 260ms cubic-bezier(.22, .8, .25, 1), background 180ms ease;
}

.figma-sidebar .user-card-main:hover {
  border-color: #2f2f31;
  background: rgba(255, 255, 255, .035);
}

.figma-sidebar .user-avatar {
  display: flex;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  text-transform: none;
}

.figma-sidebar .user-details {
  display: flex;
  min-width: 0;
  max-width: 160px;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  overflow: hidden;
  opacity: 1;
  transition: max-width 220ms cubic-bezier(.22, .8, .25, 1), opacity 140ms ease;
}

.figma-sidebar .user-name {
  width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--figma-sidebar-text);
  font-size: 14px;
  font-weight: 500;
  line-height: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.figma-sidebar .user-members {
  display: flex;
  min-height: 13px;
  align-items: center;
  gap: 0;
  color: var(--figma-sidebar-muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 14px;
}

.figma-sidebar .user-members span {
  color: var(--figma-sidebar-muted) !important;
}

.figma-sidebar .user-dropdown {
  display: block;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  opacity: 1;
  transform: rotate(90deg);
  transition: width 180ms ease, flex-basis 180ms ease, opacity 120ms ease;
}

.figma-sidebar.collapsed .user-card {
  width: 40px;
  height: 40px;
  margin: 15px 8px 0;
  padding: 0;
  flex-basis: 40px;
}

.figma-sidebar.collapsed .user-card-main {
  width: 40px;
  height: 40px;
  padding: 0;
  gap: 0;
  border-width: 0;
  border-color: #2f2f31;
  border-radius: 50%;
  background: transparent;
}

.figma-sidebar.collapsed .user-details,
.figma-sidebar.collapsed .user-dropdown {
  max-width: 0;
  opacity: 0;
  pointer-events: none;
}

.figma-sidebar.collapsed .user-dropdown {
  width: 0;
  flex-basis: 0;
}

.figma-sidebar .user-dropdown-menu {
  top: calc(100% + 6px);
  right: 0;
  left: 0;
}

.figma-sidebar .user-dropdown-menu::before {
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: 6px;
  content: "";
}

.figma-sidebar .sidebar-nav {
  min-height: 0;
  flex: 1;
  margin-top: 20px;
  padding: 0 8px 16px;
  overflow-x: hidden;
  overflow-y: auto;
}

.figma-sidebar .nav-section {
  margin: 0;
}

.figma-sidebar .nav-section-title {
  height: 20px;
  margin: 0 0 12px;
  padding: 0 14px;
  color: var(--figma-sidebar-muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 20px;
  text-transform: uppercase;
  overflow: hidden;
  opacity: 1;
  transition: height 180ms ease, margin-bottom 180ms ease, opacity 120ms ease;
}

.figma-sidebar .nav-item {
  display: flex;
  width: 100%;
  height: 40px;
  margin: 0 0 6px;
  padding: 0 12px;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  color: var(--figma-sidebar-secondary);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  transition: width 260ms cubic-bezier(.22, .8, .25, 1), padding 260ms cubic-bezier(.22, .8, .25, 1), gap 220ms ease, border-radius 220ms ease, background 180ms ease, color 180ms ease;
}

.figma-sidebar .nav-item:hover {
  border: 0;
  background: rgba(255, 255, 255, .045);
  color: var(--figma-sidebar-text);
}

.figma-sidebar .nav-item.active {
  border: 0;
  background: rgba(255, 255, 255, .08);
  color: var(--figma-sidebar-text);
}

.figma-sidebar .nav-item span:not(.figma-sidebar-icon) {
  width: auto;
  max-width: 160px;
  overflow: hidden;
  opacity: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: max-width 180ms ease, opacity 120ms ease;
}

.figma-sidebar-icon {
  display: block;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  background: currentColor;
  mask-image: var(--sidebar-icon);
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: 18px 18px;
  -webkit-mask-image: var(--sidebar-icon);
  -webkit-mask-position: center;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: 18px 18px;
}

.figma-sidebar-icon[data-icon="assets"] {
  mask-size: 13.86px 13.6275px;
  -webkit-mask-size: 13.86px 13.6275px;
}

.figma-sidebar .nav-item-disabled {
  color: var(--figma-sidebar-muted);
  cursor: default;
}

.figma-sidebar .nav-item-disabled:hover {
  background: transparent;
  color: var(--figma-sidebar-muted);
}

.figma-sidebar .nav-item small {
  display: inline-flex;
  min-width: 0;
  margin-left: 0;
  padding: 4px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(199, 219, 240, .3);
  border-radius: 4px;
  color: var(--figma-sidebar-muted);
  font-size: 8px;
  font-weight: 500;
  line-height: 8px;
  white-space: nowrap;
  transition: max-width 180ms ease, padding 180ms ease, border-color 120ms ease, opacity 120ms ease;
}

.figma-sidebar .sidebar-bottom {
  display: flex;
  width: 100%;
  padding: 0 8px 12px;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 0;
  transition: width 260ms cubic-bezier(.22, .8, .25, 1);
}

.figma-sidebar .sidebar-bottom .nav-item:last-child {
  margin-bottom: 0;
}

.figma-sidebar .community-support-card {
  position: relative;
  display: flex;
  width: calc(var(--sidebar-panel-width) - 16px);
  min-height: 76px;
  margin-bottom: 6px;
  padding: 12.5px;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: rgba(100, 95, 252, .08);
  box-shadow: inset 0 0 0 .5px #645ffc;
  color: var(--figma-sidebar-text);
  cursor: default;
}

.figma-sidebar .community-support-card:hover { background: rgba(100, 95, 252, .2); }
.community-support-join { position: relative; display: grid; width: 66px; height: 32px; flex: 0 0 66px; place-items: center; padding: 0 5px; border: 0; border-radius: 6px; color: #0e0e0e; background: transparent; cursor: pointer; }
.community-support-join > img { position: absolute; inset: 0; width: 66px; height: 32px; max-width: none; border-radius: inherit; pointer-events: none; }
.community-support-join > span { position: relative; max-width: 100%; overflow: hidden; font-size: 12px; font-weight: 600; line-height: 12px; text-overflow: ellipsis; white-space: nowrap; }
.community-support-join:focus-visible { outline: 2px solid #645ffc; outline-offset: 2px; }

.community-support-glow,
.community-support-line {
  position: absolute;
  max-width: none;
  pointer-events: none;
}

.community-support-glow-bottom {
  bottom: -74.14px;
  left: calc(50% - 19.01px);
}

.community-support-glow-top {
  bottom: 34.86px;
  left: calc(50% - 150.01px);
}

.community-support-line-bottom {
  right: 3.77px;
  bottom: -.5px;
}

.community-support-line-top {
  top: -1.5px;
  right: 53.77px;
}

.community-support-copy {
  position: relative;
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  overflow-wrap: anywhere;
}

.community-support-copy strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 500;
  line-height: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-support-copy p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 0;
  color: var(--figma-sidebar-muted);
  font-size: 12px;
  line-height: 16px;
}

.figma-sidebar.collapsed .community-support-card {
  display: none;
}

.figma-sidebar.collapsed .sidebar-nav {
  margin-top: 20px;
  padding: 0 8px 16px;
}

.figma-sidebar.collapsed .nav-section-title {
  height: 0;
  margin-bottom: 0;
  opacity: 0;
}

.figma-sidebar.collapsed .nav-item {
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
  gap: 0;
  border-radius: 50%;
}

.figma-sidebar.collapsed .nav-item .figma-sidebar-icon {
  width: 18px;
  opacity: 1;
  overflow: visible;
}

.sidebar-nav-tooltip {
  position: fixed;
  z-index: 140;
  left: calc(var(--sidebar-collapsed-width) + 10px);
  max-width: 220px;
  padding: 7px 10px;
  overflow: visible;
  color: var(--figma-sidebar-text);
  background: #29292d;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  font: 500 13px/18px Geist, "Noto Sans SC", sans-serif;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transform: translateY(-50%);
  animation: sidebar-nav-tooltip-in 120ms ease forwards;
}

.sidebar-nav-tooltip > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav-tooltip::before {
  position: absolute;
  top: 50%;
  left: -4px;
  width: 7px;
  height: 7px;
  background: #29292d;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  border-left: 1px solid rgba(255, 255, 255, .12);
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

@keyframes sidebar-nav-tooltip-in {
  from { opacity: 0; transform: translate(4px, -50%); }
  to { opacity: 1; transform: translate(0, -50%); }
}

.figma-sidebar.collapsed .nav-item span:not(.figma-sidebar-icon),
.figma-sidebar.collapsed .nav-item small {
  max-width: 0;
  opacity: 0;
  pointer-events: none;
}

.figma-sidebar.collapsed .nav-item small {
  padding-right: 0;
  padding-left: 0;
  border-color: transparent;
}

.figma-sidebar.collapsed .sidebar-bottom {
  width: 56px;
  padding: 0 8px 12px;
}

#dashboard-projects {
  scroll-margin-top: 88px;
}

@media (max-width: 992px) {
  .figma-sidebar {
    box-shadow: 16px 0 48px rgba(0, 0, 0, .42);
  }

  .figma-sidebar:not(.open) {
    transform: translateX(calc(-100% - var(--sidebar-inset)));
  }

  .mobile-sidebar-toggle {
    visibility: visible;
    opacity: 1;
    transition: opacity 160ms ease 160ms, visibility 0s linear 160ms;
  }

  .figma-sidebar.open {
    z-index: 120;
    width: var(--sidebar-panel-width);
    border-radius: 20px;
  }

  .figma-sidebar.open + .mobile-sidebar-toggle {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition-delay: 0s, 160ms;
  }

  .sidebar-nav-tooltip {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .figma-sidebar,
  .figma-sidebar *,
  .figma-sidebar + .mobile-sidebar-toggle,
  .figma-sidebar ~ .main-content,
  .figma-sidebar ~ .main-content .top-bar {
    transition-duration: .01ms !important;
  }

  .figma-sidebar + .mobile-sidebar-toggle {
    transition-delay: 0ms !important;
  }


  .sidebar-nav-tooltip {
    animation: none;
    opacity: 1;
  }
}
